﻿<UserControl x:Class="Toon.Controls.AttributeControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             x:Name="This"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <DockPanel x:Name="LayoutRoot" Background="White">

        <StackPanel Margin="5" Width="120" DockPanel.Dock="Left">
            <TextBlock FontSize="20" Text="{Binding Name}" HorizontalAlignment="Center" />
            <Border BorderThickness="1" BorderBrush="Black" Width="40" Height="40" >
                <TextBlock FontSize="20" Text="{Binding Value}" HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Border>
            <Label Content="{Binding Derived, ElementName=This}" HorizontalContentAlignment="Center" />
        </StackPanel>

        <ItemsControl ItemsSource="{Binding Skills}" Margin="5">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel.Resources>
                            <Style TargetType="TextBlock">
                                <Setter Property="FontSize" Value="14" />
                            </Style>
                        </StackPanel.Resources>

                        <TextBlock Text="{Binding Name}" Margin="0,0,5,0" />
                        <TextBlock Text="{Binding SkillLevel}"/>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DockPanel>
</UserControl>
